﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ExtendBLL
{
    public class RoleTable:LabMS.BLL.RoleTable
    {
        /// <summary>
        /// 根据RoleName找到RoleID的值
        /// </summary>
        /// <param name="RoleName"></param>
        /// <returns></returns>
        public int GetRoleIDByRoleName(string RoleName)
        {
            int RoleID;
            string str = "RoleName='"+RoleName+"'";
            LabMS.BLL.RoleTable BRt = new LabMS.BLL.RoleTable();
            RoleID=int.Parse(BRt.GetModelList(str)[0].RoleId.ToString());
            return RoleID;
        }

        /// <summary>
        /// 根据RoleId取得角色名称RoleName
        /// </summary>
        /// <param name="RoleId"></param>
        /// <returns></returns>
        public string GetRoleNameByRoleID(int RoleId)
        {
            string str = "RoleId="+RoleId;
            LabMS.BLL.RoleTable BRT = new LabMS.BLL.RoleTable();
            string name = BRT.GetModelList(str)[0].RoleName;
            return name;
        }
    }
}
